#ifndef _OBJECTLOADER_H_
#define _OBJECTLOADER_H_

#include "stdafx.h"

class CObjectLoader : public ICreator, public ILibManager, public CUnknownImp
{
public:
    CObjectLoader(void);
    virtual ~CObjectLoader(void);

    BEGIN_STDCOM_MAP
    STDCOM_INTERFACE_ENTRY_UNKNOWN_(ICreator)
    STDCOM_INTERFACE_ENTRY(ICreator)
    STDCOM_INTERFACE_ENTRY(ILibManager)
    END_STDCOM_MAP

public:
    // ICreator
    std_method(CreateInstance)(REFCLSID clsid, IBase* punk, REFIID iid, void** ppv);
    std_method_(LPCSTR, ProgIDFromCLSID)(REFCLSID clsid);
    std_method_(CLSID, CLSIDFromProgID)(LPCSTR progid);

public:
    // IlibManager
    std_method(Load)(LPSTRING path, LPCSTR name);
    std_method(Remove)(LPCSTR name);
    std_method(Free)();
    std_method_(DWORD, GetCount)();
    std_method(Get)(LPCSTR name, basic_tchar* path, int len);
    std_method(Register)(SafeStringConstPtr name, UINT type, UINT version);
    std_method(UnRegister)(SafeStringConstPtr name, UINT type, UINT version);
    std_method(Registers)(UINT type, UINT version);
    std_method(UnRegisters)(UINT type, UINT version);

private:
    ClsIdTable m_mapCls;
    ContainerTable m_mapContainer;
    CAutoLock m_lock;
};
#endif
